package org.zjt.vertx.demo;

import io.vertx.core.Vertx;
import io.vertx.core.http.HttpServer;
import io.vertx.ext.web.Router;
import lombok.extern.slf4j.Slf4j;

import static org.zjt.vertx.demo.HttpRouter.*;

@Slf4j
public class MainVerticle {

    public static void main(String[] args) {
        Vertx vertx = Vertx.vertx();

        HttpServer server = vertx.createHttpServer();

        /**
         * 路由遵循优先精准匹配原则
         */
        Router router = Router.router(vertx);

        singleRouter(router);
        multiRouter(router);

        blockingHandler(router);

        exactRouter(router);

        patternRouter(router);

        POSTRouter(router);


        multiMethodRouter(router);


        mediaTypeRouter(router);

        multiNextRouter(router);

        server.requestHandler(router::accept).listen(8080);
    }






}
